package cn.ynrcb.personnelfile.admin.dao;

import cn.ynrcb.personnelfile.admin.entity.FileEntity;
import cn.ynrcb.personnelfile.admin.entity.PersonnelInfoEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 
 * 
 * @author wujianfan
 * @email fanxipo@qq.com
 * @date 2023-08-22 00:17:26
 */
@Mapper
public interface PersonnelInfoDao extends BaseMapper<PersonnelInfoEntity> {

    @Insert("INSERT INTO tb_file (id,file_name,file_path) VALUES (#{id},#{fileName},#{filePath})")
    void saveFile(String id, String fileName, String filePath);

    @Select("SELECT * FROM tb_file WHERE id = #{id}")
    FileEntity getFileById(String id);

    @Delete("DELETE FROM tb_file WHERE id = #{id}")
    void deleteByFileId(String id);
}
